package test6;

class Solution {
    public static int countSegments(String s) {
        int count=0;
        if(s.equals("")){
            return 0;
        }
        s=s.toLowerCase();
        String[] strs=s.split(" ");
        for (String x: strs) {
            if(!x.equals("")) {
                count++;
            }
        }

        return count;
    }

    public static void main(String[] args) {
        System.out.println(countSegments(", , , ,        a, eaefa"));
    }
}
//", , , ,        a, eaefa"